package interfaceCustomer;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.Font;

public class CustomerFrame extends JFrame {
	private CustomerPanel cp;
	private MakeSubscriptionPanel1 sp1;
	private MakeSubscriptionPanel2 sp2;
	private CreateOrderPanel op;

	public CustomerFrame() {	
		setTitle("Main Menu");
		this.setSize(700,600);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		this.getContentPane().setBackground(Color.LIGHT_GRAY);
		
		cp=new CustomerPanel(this);
		this.setContentPane(cp);
		
		op=null;
		this.setVisible(true);
	}
	
	public void ChangePanel(double num) {
		if (num == 0) {
			this.setTitle("Main Menu");
			this.setContentPane(cp);
		}
		if (num == 1 && op == null) {          //if no CreateOrderPanel was created
			this.setTitle("Order New Parking Spot");
			this.setContentPane(op = new CreateOrderPanel(this));
			this.setVisible(true);
		}
		if (op != null && (num == 1)) {      //if CreateOrderPanel is alreadt created
			this.setTitle("Order New Parking Spot");
			this.setContentPane(op);
			this.setVisible(true);
		}
		if (num == 2) {
			this.setTitle("Send Complaint to Customer Service");
			this.setContentPane(new CustomerSendComplaintPanel(this));
			this.setVisible(true);
		}
		if (num == 3) {
			this.setTitle("Register For Subscription: Choose Car");
			this.setContentPane(sp1 = new MakeSubscriptionPanel1(this));
			this.setVisible(true);
		}
		if (num == 0.3) {
			this.setTitle("Register For Subscription: Choose Car");
			this.setContentPane(sp1);
			this.setVisible(true);
		}
		if (num == 3.1) {
			this.setTitle("Register For Subscription: Choose Subscription Type");
			this.setContentPane(sp2 = new MakeSubscriptionPanel2(this));
			this.setVisible(true);
		}
		if (num ==3.11) {
			this.setTitle("Register For Fully Subsctiption");
			this.setContentPane(new FullSubscriptionPanel(this));
			this.setVisible(true);
		}
		if (num ==3.12) {
			this.setTitle("Register For Monthly Subsctiption");
			this.setContentPane(new MonthlySubscriptionPanel(this));
			this.setVisible(true);
		}
		if (num == 3.121) {
			this.setTitle("Register For Subscription: Choose Subscription Type");
			this.setContentPane(sp2);
			this.setVisible(true);
		}
		if (num == 4) {
			this.setTitle("Renew Subscription");
			this.setContentPane(new RenewSub(this));
			this.setVisible(true);
		}
		if (num == 5) {
			this.setTitle("My Orders");
			this.setContentPane(new CustomerLookUpOrderPanel(this));
			this.setVisible(true);
		}
		
		if (num == 6) {
			this.setVisible(false);
			new interfaceLogin.Login();
		}
		
		
		
	}
} 
